import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
//创建子路由容器
import childrenView from '@/components/public/childrenView'

import list from './list.js'
import particuars from './particuars.js'
import user from './user.js'
import about from './about.js'
import others from './others.js'
Vue.use(Router)

export default new Router({
	routes: [{
		path: '/',
		name: 'index',
		component: index,
		meta: {
			title: '蜗居'
		}
	}, {
		path: '/particuars/:id',
		name: 'particuars',
		component: childrenView,
		children: particuars,
		meta: {
			title: '房源详情'
		}
	}, {
		path: '/list/:id',
		name: 'list',
		component: childrenView,
		children: list,
		meta: {
			title: '房源列表'
		}
	}, {
		path: '/user',
		name: 'user',
		component: childrenView,
		children: user
	}, {
		path: '/about',
		name: 'about',
		component: childrenView,
		children: about,
		meta: {
			title: '关于蜗居'
		}
	}, {
		path: '/others',
		name: 'others',
		component: childrenView,
		children: others,
		meta: {
			title: '蜗居找房'
		}
	}]
})